package router

import (
	restfulspec "github.com/emicklei/go-restful-openapi/v2"
	"github.com/emicklei/go-restful/v3"
)

func AddHealthService(container *restful.Container) {
	ws := new(restful.WebService)
	tags := []string{"General"}
	ws.Route(ws.GET("/health").
		Metadata(restfulspec.KeyOpenAPITags, tags).
		To(healthCheck))

	container.Add(ws)
}

func healthCheck(req *restful.Request, resp *restful.Response) {
	_ = resp.WriteAsJson("success")
}
